package com.atguigu.springcloud.alibaba.service.impl;

import com.atguigu.springcloud.alibaba.dao.StorageDao;
import com.atguigu.springcloud.alibaba.service.StorageService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * @author xiaolong
 * @version 1.0
 * @description: TODO
 * @date 2021/10/10 14:34
 */
@Service
@Slf4j
public class StorageServiceImpl implements StorageService {

    @Resource
    private StorageDao storageDao;

    /**
     * @description: 扣减库存
     */
    @Override
    public void decrease(Long productId, Integer count) {

        log.info("----->storage 中扣减库存开始");
        storageDao.decrease(productId, count);
        log.info("----->storage 中扣减库存结束");
    }
}
